//TODO  实现服用功能
import {onBeforeUnmount, onMounted, reactive} from "vue";
//实现鼠打点相关的数据
export default  function (){
    let point =reactive({
        x:0,
        y:0
    })

//方法
    function savePoint(event){
        point.x=event.pageX
        point.y=event.pageY
    }
    onMounted(()=>{
        window.addEventListener('click',savePoint)
    })
    onBeforeUnmount(()=>{
        window.removeEventListener('click',savePoint)
    })
    return point
}
